package ch7;
//兽医
public class Veterinarian {
    private String name,telephone;
    private int age;

    public Veterinarian(String name, String telephone, int age) {
        this.name = name;
        this.telephone = telephone;
        this.age = age;
    }
    public void cure(Pet p){
        p.print();

        System.out.println("兽医"+this.name+"正在给"+p.getName()+"看病");
        if (p instanceof Crocodile ) {
            ((Crocodile ) p).youYong();
            System.out.println("危险,b把"+this.getName()+"的嘴捆起来。");
        }else if(p instanceof Hamster){
            ((Hamster)p).bite();
        }
        System.out.println("望闻问切");
        if (p.getHealth()<60) {
            System.out.println("打针，吊水，吃药");
            System.out.println("本次治疗费1800");
        }else{
            System.out.println("兽医"+this.name+"说这个"+p.getName()+"很健康，无需治疗");
        }
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getTelephone() {
        return telephone;
    }

    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
